package Lesson.Student;

import Domain.Student;

public class TestStudent {
    public static void main(String[] args) {
        //创建对象数组
        Student[] arr = new  Student[3];

        //创建对象
        Student stu1 = new Student("张三",23);
        Student stu2 = new Student("李四",24);
        Student stu3 = new Student("王五",25);

        //将对象存入数组
        arr[0] = stu1;
        arr[1] = stu2;
        arr[2] = stu3;

        //遍历数组
        for (int i = 0; i < arr.length; i++) {
            Student temp = (arr[i]);
            System.out.println(temp.getName()+"..."+temp.getAge());
        }

    }
}
